package com.jack.vipmis.vip.wei.entity;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import org.springframework.format.annotation.DateTimeFormat;

import com.jack.vipmis.common.entity.BaseEntity;
import com.jack.vipmis.system.user.entity.User;

/**
 * 
 * @author JackLiang
 * @version 1.0
 * @date 2014-6-17
 */
@Entity
@Table(name = "tribune")
public class Tribune extends BaseEntity<Long> {

	@Column
	private String				tname;						// 标题

	@Column
	private TribuneCategoryEnum	ttype;						// 发帖类型

	@Column
	private String				tcontent;					// 内容

	@Column(name = "create_time")
	@Temporal(TemporalType.TIMESTAMP)
	@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	private Date				tcreateTime	= new Date();	// 创建时间

	@ManyToOne(optional = true)
	@JoinColumn(name = "user_id")
	private User				userId;					// 用户Id

	@Column(name = "create_user")
	private String				userName;					// 用户姓名

	@Column
	private Integer				tgood;						// 赞

	@Column
	private Integer				tbad;						// 差评

	@Column(name = "is_show")
	private Boolean				show;

	public String getTname() {
		return tname;
	}

	public TribuneCategoryEnum getTtype() {
		return ttype;
	}

	public void setTtype(TribuneCategoryEnum ttype) {
		this.ttype = ttype;
	}

	public String getTcontent() {
		return tcontent;
	}

	public void setTcontent(String tcontent) {
		this.tcontent = tcontent;
	}

	public Date getTcreateTime() {
		return tcreateTime;
	}

	public void setTcreateTime(Date tcreateTime) {
		this.tcreateTime = tcreateTime;
	}

	public User getUserId() {
		return userId;
	}

	public void setUserId(User userId) {
		this.userId = userId;
	}

	public String getUserName() {
		return userName;
	}

	public void setUserName(String userName) {
		this.userName = userName;
	}

	public Integer getTgood() {
		return tgood;
	}

	public void setTgood(Integer tgood) {
		this.tgood = tgood;
	}

	public Integer getTbad() {
		return tbad;
	}

	public void setTbad(Integer tbad) {
		this.tbad = tbad;
	}

	public Boolean getShow() {
		return show;
	}

	public void setShow(Boolean show) {
		this.show = show;
	}

	public void setTname(String tname) {
		this.tname = tname;
	}

}
